#include<bits/stdc++.h>
using namespace std;

int main(){
    long long arr[11] = {};
    long long k = 0;
    long long a = 1;
    memset(arr,0,sizeof(arr));
    int n;
    cin>>n;

    for(int i = 1;i <= 10;i++){
        arr[i] = n/a%10;//从最后一位开始，依次存入到数组当中
        a*=10;
    }
    a=1000000000;
    for(int i = 1;i <= 10;i++){
        k += arr[i]*a;
        a/=10;
    }
    while(k % 10 ==0)k/=10;
    cout<<k;


    return 0;
}